<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;

    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
    }
  }
}
</style>

<template>
  <div class="panel">
    <!-- 企业名称 -->
    <qiye :dt="item.qiye||[]"></qiye>

    <!-- 注册资本 -->
    <zhuce :dt="item.zhuce||[]"></zhuce>

    <!-- 地址 -->
    <dizhi :dt="item.dizhi||[]"></dizhi>

    <!-- 经营范围 -->
    <jingying :dt="item.jingying||[]"></jingying>

    <!-- 主要人员 -->
    <zhuyao :dt="item.zhuyao||[]"></zhuyao>

  </div>
</template>
<script>
import Qiye from './qiye';
import Zhuce from './zhuce';
import Dizhi from './dizhi';
import Jingying from './jingying';
import Zhuyao from './zhuyao';

export default {
  components: {
    Qiye,
    Zhuce,
    Dizhi,
    Jingying,
    Zhuyao
  },
  data() {
    return {
      item: {}
    };
  },
  onLoad() {
    this.getInfos();
  },
  methods: {
    async getInfos() {
      const url = '/app/getEntHistoryInfo_VIP';
      let unique = '';
      try {
        unique = this.$root.$mp.page.options.Unique;
      } catch (error) {}
      const params = {
        unique
      };

      const {
        status,
        message,
        result: {
          AddressList,
          CompanyNameList,
          EmployeeList,
          RegistCapiList,
          ScopeList
        }
      } = await this.$http.get(url, params);
      if (status !== 200) {
        wx.showToast({
          title: message || '查询失败！',
          icon: 'none',
          duration: 2000
        });
        return;
      }
      this.item = {
        qiye: CompanyNameList,
        zhuce: RegistCapiList,
        dizhi: AddressList,
        jingying: ScopeList,
        zhuyao: EmployeeList
      };
    }
  }
};
</script>
